﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace Models
{
    public class Tag
    {
        [Required(ErrorMessage = "Required field Name")]
        [MinLength(3, ErrorMessage = "Length < 3")]
        [MaxLength(50, ErrorMessage = "Length > 50")]
        public string Name { get; set; }
        [Key]
        public int Id { get; set; }

    }

    public class TagComparer:IComparer<Tag>
    {
        int IComparer<Tag>.Compare(Tag x, Tag y)
        {
            int returnValue = x.Id - y.Id;
            return returnValue;
        }
    }
}